package com.xunqi.dto;

public class ResponseDTO {

	/** 时间戳：方便定位问题 */
	private long timestamp = System.currentTimeMillis();
	/** 返回编码 */
	private int code = 0;
	/** 返回消息 */
	private String msg = "SUCCESS";
	/** 返回的数据 */
	private Object data;

	/** 默认成功 */
	public ResponseDTO() {

	}
	
	/** 带数据的成功返回 */
	public ResponseDTO(Object data) {
		this.data = data;
	}

	public ResponseDTO(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public ResponseDTO(int code, String msg, Object data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public static ResponseDTO SUCCESS = new ResponseDTO();

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

}
